define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'orev.order_evaluate/index',
        add_url: 'orev.order_evaluate/add',
        edit_url: 'orev.order_evaluate/edit',
        delete_url: 'orev.order_evaluate/delete',
        export_url: 'orev.order_evaluate/export',
        modify_url: 'orev.order_evaluate/modify',
    };
    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {field: 'order_no', minWidth: 80, title: '订单号'},
                    {field: 'user_name', minWidth: 80, title: '评论用户',search: false},
                    {field: 'service_name', minWidth: 80, title: '产品名称',search: false},
                    {field: 'star_rating', title: '星级',selectList: {1: '一星',2: '二星',3: '三星',4: '四星',5: '五星'}},
                    {field: 'status', title: '显示/隐藏', selectList: {0: '显示', 1: '隐藏'}, templet: ea.table.switch},
                    {field: 'create_time', title: '下单时间',search: false},
                    {title: '操作', templet: ea.table.tool,operat:[
                        [
                            {
                                text: '查看评价内容',
                                url: init.edit_url,
                                method: 'open',
                                auth: 'edit',
                                class: 'layui-btn layui-btn-xs layui-btn-success'
                            }
                       ],'delete'
                    ]},
                ]],
            });
            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});